class Solution {
public:
    int findKthLargest(vector<int>& nums, int k)
    {
        priority_queue<int> q(nums.begin(), nums.begin() + k);
        for (int i = k; i < nums.size(); i++)
        {
            q.push(nums[i]);
        }
        int tmp = 0;
        for (int i = 0; i < k - 1; i++)
        {
            q.pop();
        }
        return q.top();
    }
};